<!-- paypal - item -->
<template>
	<div 
		class="pos-r item-paypal pl-16 flex a-c j-sb" 
		:class="showDefault?(item.isDefault == true ? 'pr-20 item-default' : 'item-normal pr-20'):'pr-40'"
		@click="itemClick"
		>
		<!-- 默认收款账户 -->
		<div v-if="showDefault && item.isDefault == true" class="account-default bg-222 flex a-c j-c plr-10 col-fff f-12 lin-12 pos-a">
			{{$t('setting.settingDefault')}}
		</div>
		<div class="flex a-c">
			<img class="paypal-icon" src="@/assets/images/user/account-paypal.png" alt="">
			<div class="col-222 f-14 lin-14 ml-16">
				{{item.payPalAccount||''}}
			</div>
		</div>
		<div>
			<div class="t-r col-888 f-10 lin-16 mb-8" v-if="item.isDefault && !showDefault">
				{{$t('setting.settingDefault')}}
			</div>
			<div class="flex a-c j-e">
				<div class="flex a-c j-e f-12 lin-18 col-888">
					<!-- 删除 -->
					<div class="c-p flex a-c j-c" @click.stop="itemDel" v-if="showDefault">
						<img class="op-icon" src="@/assets/images/user/account-del.png" alt="">
						<div class="ml-4">
							{{$t('user.delete')}}
						</div>
					</div>
					<!-- 编辑 -->
					<div class="c-p flex a-c j-c ml-16" @click.stop="itemEdit">
						<img class="op-icon" src="@/assets/images/user/account-edit.png" alt="">
						<div class="ml-4">
							{{$t('user.edit')}}
						</div>
					</div>
					<!-- 设为默认 -->
					<div class="c-p flex a-c j-c ml-16" v-if="showDefault && item.isDefault != true" @click.stop="itemSetDefault">
						<img class="op-icon" src="@/assets/images/user/set-def-account.png" alt="">
						<div class="ml-4">
							{{$t('setting.settingToDefault')}}
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				
			}
		},
		props:{
			item:{
				type:Object,
				default(){
					return{}
				}
			},
			//是否显示默认地址
			showDefault:{
				type:Boolean,
				default:false
			}
		},
		methods:{
			//删除
			itemDel(){
				this.$emit('delItem',this.item)
			},
			//编辑
			itemEdit(){
				this.$emit('editItem',this.item)
			},
			//设为默认
			itemSetDefault(){
				this.$emit('defaultItem',this.item)
			},
			//整个选项点击
			itemClick(){
				this.$emit('clickItem',this.item)
			}
		}
	}
</script>

<style lang="less" scoped>
	.item-paypal{
		height:100px;
		.paypal-icon{
			width:32px;
			height:32px;
		}
		.account-default{
			top:0;
			right:0;
			min-width:92px;
			height:26px;
			border-radius: 0px 2px 0px 2px;
		}
		.currency-item{
			height:18px;
		}
		.op-icon{
			width:16px;
			height:16px;
		}
	}
	.item-paypal.item-normal{
		border:1px solid #E2E2E2;
	}
	.item-paypal.item-default{
		border:3px solid #222;
	}
</style>